package com.ln.dm1103.demo01;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/3 15:30
 */
public class Test01 {
    public static void main(String[] args) {
        Happy happy = new Happy(){
            @Override
            public void happy(){
                System.out.println("匿名内部类");
            }
        };
        fun(happy);

        Happy happy1=()->{
            System.out.println("Lambda表达式");
        };
        fun(happy1);
    }
    public static void fun(Happy h){
        h.happy();
    }
}
@FunctionalInterface
interface Happy{
    public void happy();
}
